package com.bjypc.youth.web;

import java.io.File;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.springframework.context.MessageSource;

import com.opensymphony.xwork2.ActionSupport;

public class BasicDataConfigAction extends ActionSupport {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 1049039797219731809L;
	Logger logger = Logger.getLogger(BasicDataConfigAction.class);
	private MessageSource messageSource;
	private String msg;
	private String basicDataUrl;

	public BasicDataConfigAction() {
		super();
	}

	@Override
	public String execute() throws Exception {
		// basic datas in deployed server path
		String basicdataDir = ServletActionContext.getServletContext()
				.getRealPath("/basicdata/");
		// basic data in disk
		this.basicDataUrl= messageSource.getMessage("BasicDataUrl", null,
				"http://localhost/beijing2008/", null);
	

		// check
		logger.info("basicdata in Web Server directory:" + basicdataDir);
		logger.info("basicdata Url:" + basicDataUrl);
	
		return SUCCESS;
	}

	public MessageSource getMessageSource() {
		return messageSource;
	}

	public void setMessageSource(MessageSource messageSource) {
		this.messageSource = messageSource;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getBasicDataUrl() {
		return basicDataUrl;
	}

	public void setBasicDataUrl(String basicDataUrl) {
		this.basicDataUrl = basicDataUrl;
	}
	

}
